# Maintainer: Johannes Löthberg <johannes@kyriasis.com>

pkgname=python-prometheus_client
pkgver=0.11.0
pkgrel=1

pkgdesc="Prometheus instrumentation library for Python applications"
url="https://github.com/prometheus/client_python"
arch=('any')
license=('APACHE')

depends=('python')
makedepends=('python-setuptools')
checkdepends=('python-twisted' 'python-pytest')

source=(client_python-$pkgver.tar.gz::https://github.com/prometheus/client_python/archive/v${pkgver}.tar.gz)

sha512sums=('5e644d781b7fcc3e0e386a2244f524ccaf978f1eab87b1d6d8009ac3f10fe2ca4adf2c76c2a2ffa47b4b54237cd906807d55bd99530a92d82cd3825de93280dc')

build() {
  cd client_python-$pkgver
  python setup.py build
}

check() {
  cd client_python-$pkgver
  # Make reproducible by not writing pyc files for test files. (rebuilderd does not run tests)
  PYTHONDONTWRITEBYTECODE=1 python setup.py test
}

package() {
  cd client_python-$pkgver
  python setup.py install --root="$pkgdir" --skip-build --optimize=1
}
